//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'
//导入组件
import LoginVue from '@/views/adm/admLogin.vue'
import LayoutVue from '@/views/adm/AdmLayout.vue'
import AdmInfo from '@/views/adm/admInfo.vue'
import UpdatePwd  from'@/views/adm/UpdatePwd.vue'
import sportsProject from'@/views/adm/sportsProject.vue'
import StudentInfo from '@/views/adm/StudentInfo.vue'
import TeacherInfo from '@/views/adm/TeacherInfo.vue'
import SprotsApply from '@/views/adm/sports_apply.vue'
import publicFile from '@/views/adm/publicfile.vue'
import addGradue from '@/views/adm/addGradue.vue'
import sportsGradue from '@/views/adm/sportsGradue.vue'
import sportsSeting from '@/views/adm/sportsSeting/sportsSeting.vue'
//User
//导入组件
import userLoginVue from '@/views/user/userLogin.vue'
import UserLayoutVue from '@/views/user/UserLayout.vue'
import UsersportsProject from'@/views/user/sportsProject.vue'
import UserSprotsApply from '@/views/user/sportsApply.vue'
import newsFile from '@/views/user/NewsFile.vue'
import UsersportsGradue from '@/views/user/sportsGradue.vue'
import Myfile from '@/views/user/UserInfo.vue'


//test
import test from '@/views/adm/statistic.vue'
import { compose } from 'element-plus/es/components/table/src/util'
//定义路由关系
const routes = [
    { 
        path: '/admmanage', 
        component: LayoutVue,
        //重定向
        redirect: '/adm/index',
        children:[
        {path:'/Info',component:AdmInfo},
        {path:'/UpdatePwd',component:UpdatePwd},
        {path:'/sportsProject/page',component:sportsProject},
        {path:'/adm/StudentInfo',component:StudentInfo},
        {path:'/adm/TeacherInfo',component:TeacherInfo},
        {path:'/adm/sprotsApply',component:SprotsApply},
        {path:'/adm/index',component:test},
        {path:'/adm/news',component:publicFile},
        {path:'/adm/addGradue',component:addGradue},
        {path:'/adm/sportsGradue',component:sportsGradue},
        {path:'/adm/sportsSeting',component:sportsSeting}
        ]
    },
    { path: '/adm/login', component: LoginVue },
    { 
        path: '/userManage', 
        component: UserLayoutVue,
        //重定向
        redirect: '/user/index',
        children:[
        {path:'/user/sportsProject',component:UsersportsProject},
        {path:'/user/sprotsApply',component:UserSprotsApply},
        {path:'/user/index',component:newsFile},
        {path:'/user/sportsGradue',component:UsersportsGradue},
        {path:'/user/UpdatePwd',component:UpdatePwd},
        {path:'/user/info',component:Myfile}
        ]
    },
    { path: '/user/login', component: userLoginVue },
    { path: '/', component: userLoginVue }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
});

export default router